import random
import os

path = os.getcwd()

# 读取文件内容
with open(path + "\\2025_07_01\\score.txt", "r", encoding="utf-8") as file:
    lines = file.readlines()

# 解析学生名单
students = [line.strip().split()[0] for line in lines]

# 计算需要抽取的学生数量
num_students_to_select = max(1, int(len(students) * 0.3))  # 至少抽取1名学生

# 随机抽取学生
selected_students = random.sample(students, num_students_to_select)

# 输出结果
print("被抽取参加答辩的学生名单：")
for student in selected_students:
    print(student)
